import { useState, useEffect } from "react";

function App() {
  const [count, setCount] = useState(0);
  // 使用useEffect模仿生命周期
  useEffect(()=>{
    console.log(`你点击了${count}次`)
  })
  return (
    <div>
      <div>次数:{count}</div>
      <button onClick={() => {setCount(count + 1);}}>增加次数</button>
    </div>
  );
}

export default App;
